<?php
/**
 * @content: yaml解析器
 * @author: xuch
 */
class File_YmlFile extends File_Abstract_File {
	private $_yml = array();
	public function __construct ($file) {
		echo $file;
		//parent::__construct($file);
		$this->_file = $file;
		//echo $this->_file;
	}
	public function parse () {
		
		if (file_exists($this->_file)) {
			$this->_yml = yaml_parse_file($this->_file);
			var_dump($this->_yml);
		}
		else {
			echo '无法找到文件';
		}
	}
	
	public function get ($key) {
		if (is_string($key) && isset($this->_yml[$key])) {
			return $this->_yml[$key];
		}
	}
}